In recent years, with the advance of a semiconductor device, measurement and inspection techniques of a semiconductor have become important more and more. A scanning electron microscope which is typified by a critical dimension-scanning electron microscope (CD-SEM) is an apparatus which scans a sample with electron beams, and detects electrons such as secondary electrons emitted from the sample so that a pattern formed on a semiconductor device is measured. In order to perform highly accurate measurement and inspection in such an apparatus, it is necessary to set appropriate conditions of the apparatus, but, among recent devices, there are samples which are charged due to irradiation with electron beams or due to an influence of a semiconductor process. Particularly, insulating samples such as a resist, an insulating film, and a low-k material are known as samples which are easily charged.
If a sample is charged, a trajectory of an electron may be bent, and this causes astigmatism or an image blur. PTLs 1 to 4 disclose techniques in which a charging amount is measured, and a state of an apparatus is controlled on the basis of the information in order to appropriately focus on such a charged sample. PTLs 1 to 3 disclose scanning electron microscopes which cancel an influence of charging on a sample by adjusting a voltage applied to the sample. In addition, PTL 4 discloses a method in which a voltage applied to a sample is made higher than an acceleration voltage of an electron beam so that the electron beam does not reach the sample but is reflected therefrom, and a sample potential is detected on the basis of an electron which is obtained by using the reflected electron beam.